package cn.brilliantfuture.commentry.entity;

// Generated 2010-9-25 13:15:16 by Hibernate Tools 3.3.0.GA

import static javax.persistence.GenerationType.IDENTITY;

import java.util.Date;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.hibernate.validator.Length;
import org.hibernate.validator.NotNull;
import org.hibernate.validator.Pattern;

/**
 * Lockers generated by hbm2java
 */
@Entity
@Table(name = "lockers", catalog = "cabinet")
public class Lockers implements java.io.Serializable {

	private static final long serialVersionUID = 1L;
	private Integer lockersId;
	private Device device;
	private LockersModel lockersModel;
	private Location location;
	private String lockersName;
	private String lockersEnName;
	private String lockersSn;
	private String description;
	private Date insertTime;
	private Integer insertUser;
	private Integer lockersType = 1; // 1专用2公用
	private boolean deliveryBusiness = true; //配送业务
	private boolean storageBusiness = false; //收储业务
	private boolean refundBusiness = false; //退货业务
	private Set<LockersGroup> lockersGroups = new HashSet<LockersGroup>(0);
	private boolean deleted;
	private boolean used;
	private boolean tempBoardState;
	private boolean lockBoardState;
	private boolean keyboardState;
	private boolean readerState;
	private boolean barcodeGunState;
	private boolean ledBoardState;
	private Date publishTime;
	private Set<StorageGrid> storageGrids = new HashSet<StorageGrid>(0);
	private Set<LockerDeliveryPerson> lockerDeliveryPersons = new HashSet<LockerDeliveryPerson>(
			0);
	private Set<DeliveryAddress> deliveryAddresses = new HashSet<DeliveryAddress>(
			0);

	private Set<DeliveryPlan> deliveryPlans = new HashSet<DeliveryPlan>(0);
	
	private Set<LockersPubGroup> lockersPubGroups = new HashSet<LockersPubGroup>(0);
	private Set<AdvertPubRecord> advertPubRecords = new HashSet<AdvertPubRecord>(0);
	private Set<StorageServiceInfo> storageServiceInfos = new HashSet<StorageServiceInfo>(0);
	private Set<StorageServiceKey> storageServiceKeys = new HashSet<StorageServiceKey>(0);
	private Set<ReservePlan> reservePlans = new HashSet<ReservePlan>(0);
	
	public Lockers() {
	}

	public Lockers(Device device, Location location, String lockersName,Set<DeliveryPlan> deliveryPlans,
			boolean deleted, String lockersEnName) {
		this.deliveryPlans = deliveryPlans;
		this.device = device;
		this.location = location;
		this.lockersName = lockersName;
		this.deleted = deleted;
		this.lockersEnName = lockersEnName;
	}

	public Lockers(Device device, Location location, String lockersName,Set<DeliveryPlan> deliveryPlans,
			String description, Date insertTime, Integer insertUser,
			boolean deleted, Set<StorageGrid> storageGrids,
			String groupTempName,
			Set<LockerDeliveryPerson> lockerDeliveryPersons,
			String lockersEnName, Set<DeliveryAddress> deliveryAddresses) {
		this.deliveryPlans = deliveryPlans;
		this.device = device;
		this.location = location;
		this.lockersName = lockersName;
		this.description = description;
		this.insertTime = insertTime;
		this.insertUser = insertUser;
		this.deleted = deleted;
		this.storageGrids = storageGrids;
		this.lockerDeliveryPersons = lockerDeliveryPersons;
		this.lockersEnName = lockersEnName;
		this.deliveryAddresses = deliveryAddresses;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "lockers_id", unique = true, nullable = false)
	public Integer getLockersId() {
		return this.lockersId;
	}

	public void setLockersId(Integer lockersId) {
		this.lockersId = lockersId;
	}

	@OneToOne
	@JoinColumn(name = "device_sn", nullable = true)
	public Device getDevice() {
		return this.device;
	}

	public void setDevice(Device device) {
		this.device = device;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "location_id", nullable = false)
	@NotNull
	public Location getLocation() {
		return this.location;
	}

	public void setLocation(Location location) {
		this.location = location;
	}

	@Column(name = "lockers_name", nullable = false, length = 45)
	@NotNull
	@Length(max = 45)
	public String getLockersName() {
		return this.lockersName;
	}

	public void setLockersName(String lockersName) {
		this.lockersName = lockersName;
	}

	@Column(name = "description", length = 256)
	@Length(max = 256)
	public String getDescription() {
		return this.description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "insert_time", length = 10)
	public Date getInsertTime() {
		return this.insertTime;
	}

	public void setInsertTime(Date insertTime) {
		this.insertTime = insertTime;
	}

	@Column(name = "insert_user")
	public Integer getInsertUser() {
		return this.insertUser;
	}

	public void setInsertUser(Integer insertUser) {
		this.insertUser = insertUser;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "lockers")
	public Set<LockersGroup> getLockersGroups() {
		return this.lockersGroups;
	}

	public void setLockersGroups(Set<LockersGroup> lockersGroups) {
		this.lockersGroups = lockersGroups;
	}

	@Column(name = "lockers_type")
	public Integer getLockersType() {
		return lockersType;
	}

	public void setLockersType(Integer lockersType) {
		this.lockersType = lockersType;
	}

	@Column(name = "deleted", nullable = false)
	public boolean isDeleted() {
		return deleted;
	}

	public void setDeleted(boolean deleted) {
		this.deleted = deleted;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "lockers")
	public Set<StorageGrid> getStorageGrids() {
		return this.storageGrids;
	}

	public void setStorageGrids(Set<StorageGrid> storageGrids) {
		this.storageGrids = storageGrids;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "lockers_model_id", nullable = false)
	@NotNull
	public LockersModel getLockersModel() {
		return lockersModel;
	}

	public void setLockersModel(LockersModel lockersModel) {
		this.lockersModel = lockersModel;
	}

	@Column(name = "used", nullable = false)
	public boolean isUsed() {
		return used;
	}

	public void setUsed(boolean used) {
		this.used = used;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "lockers")
	public Set<LockerDeliveryPerson> getLockerDeliveryPersons() {
		return lockerDeliveryPersons;
	}

	public void setLockerDeliveryPersons(
			Set<LockerDeliveryPerson> lockerDeliveryPersons) {
		this.lockerDeliveryPersons = lockerDeliveryPersons;
	}

	@Column(name = "lockers_en_name", nullable = false, length = 100)
	@NotNull
	@Length(max = 100)
	@Pattern(regex = "^[a-zA-Z0-9.\\s*]+$", message = "英文名称格式不正确")
	public String getLockersEnName() {
		return lockersEnName;
	}

	public void setLockersEnName(String lockersEnName) {
		this.lockersEnName = lockersEnName;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "lockers")
	public Set<DeliveryAddress> getDeliveryAddresses() {
		return deliveryAddresses;
	}

	public void setDeliveryAddresses(Set<DeliveryAddress> deliveryAddresses) {
		this.deliveryAddresses = deliveryAddresses;
	}

	@Column(name = "lockers_sn", length = 4)
	@Length(min = 4, max = 4)
	public String getLockersSn() {
		return lockersSn;
	}

	public void setLockersSn(String lockersSn) {
		this.lockersSn = lockersSn;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "lockers")
	public Set<DeliveryPlan> getDeliveryPlans() {
		return deliveryPlans;
	}

	public void setDeliveryPlans(Set<DeliveryPlan> deliveryPlans) {
		this.deliveryPlans = deliveryPlans;
	}
	
	@OneToMany(fetch = FetchType.LAZY, mappedBy = "lockers")
	public Set<LockersPubGroup> getLockersPubGroups() {
		return lockersPubGroups;
	}

	public void setLockersPubGroups(Set<LockersPubGroup> lockersPubGroups) {
		this.lockersPubGroups = lockersPubGroups;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "lockers")
	public Set<AdvertPubRecord> getAdvertPubRecords() {
		return advertPubRecords;
	}

	public void setAdvertPubRecords(Set<AdvertPubRecord> advertPubRecords) {
		this.advertPubRecords = advertPubRecords;
	}

	@Column(name = "temp_board_state", nullable = false)
	public boolean isTempBoardState() {
		return tempBoardState;
	}

	public void setTempBoardState(boolean tempBoardState) {
		this.tempBoardState = tempBoardState;
	}

	@Column(name = "lock_board_state", nullable = false)
	public boolean isLockBoardState() {
		return lockBoardState;
	}

	public void setLockBoardState(boolean lockBoardState) {
		this.lockBoardState = lockBoardState;
	}

	@Column(name = "keyboard_state", nullable = false)
	public boolean isKeyboardState() {
		return keyboardState;
	}

	public void setKeyboardState(boolean keyboardState) {
		this.keyboardState = keyboardState;
	}

	@Column(name = "reader_state", nullable = false)
	public boolean isReaderState() {
		return readerState;
	}

	public void setReaderState(boolean readerState) {
		this.readerState = readerState;
	}

	@Column(name = "barcode_gun_state", nullable = false)
	public boolean isBarcodeGunState() {
		return barcodeGunState;
	}

	public void setBarcodeGunState(boolean barcodeGunState) {
		this.barcodeGunState = barcodeGunState;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "publish_time", length = 19)
	public Date getPublishTime() {
		return publishTime;
	}

	public void setPublishTime(Date publishTime) {
		this.publishTime = publishTime;
	}

	@Column(name = "led_board_state", nullable = false)
	public boolean isLedBoardState() {
		return ledBoardState;
	}

	public void setLedBoardState(boolean ledBoardState) {
		this.ledBoardState = ledBoardState;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "lockers")
	public Set<StorageServiceInfo> getStorageServiceInfos() {
		return storageServiceInfos;
	}

	public void setStorageServiceInfos(Set<StorageServiceInfo> storageServiceInfos) {
		this.storageServiceInfos = storageServiceInfos;
	}

	@Column(name = "is_delivery_business", nullable = false)
	public boolean isDeliveryBusiness() {
		return deliveryBusiness;
	}

	public void setDeliveryBusiness(boolean deliveryBusiness) {
		this.deliveryBusiness = deliveryBusiness;
	}

	@Column(name = "is_storage_business", nullable = false)
	public boolean isStorageBusiness() {
		return storageBusiness;
	}

	public void setStorageBusiness(boolean storageBusiness) {
		this.storageBusiness = storageBusiness;
	}

	@Column(name = "is_refund_business", nullable = false)
	public boolean isRefundBusiness() {
		return refundBusiness;
	}

	public void setRefundBusiness(boolean refundBusiness) {
		this.refundBusiness = refundBusiness;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "lockers")
	public Set<StorageServiceKey> getStorageServiceKeys() {
		return storageServiceKeys;
	}

	public void setStorageServiceKeys(Set<StorageServiceKey> storageServiceKeys) {
		this.storageServiceKeys = storageServiceKeys;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "lockers")
	public Set<ReservePlan> getReservePlans() {
		return reservePlans;
	}

	public void setReservePlans(Set<ReservePlan> reservePlans) {
		this.reservePlans = reservePlans;
	}
}
